Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go: Implement ClientId #3077

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

EdricCua
Copy link
Collaborator

@EdricCua EdricCua commented Feb 5, 2025

Issue link

This Pull Request is linked to issue (URL): [REPLACE ME]

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Signed-off-by: EdricCua <[email protected]>
@EdricCua EdricCua requested a review from a team as a code owner February 5, 2025 00:33
Signed-off-by: EdricCua <[email protected]>
if err != nil {
return createEmptyClusterValue[int64](), err
}
if opts.Route != nil &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the nil check here as the isMultiNode function has default implementation in request_routing_config.go :-

type Route interface {
	ToRoutesProtobuf() (*protobuf.Routes, error)
	IsMultiNode() bool
}

type notMultiNode struct{}

func (*notMultiNode) IsMultiNode() bool { return false }

Can you check once this ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a user call ClientIdWithOptions(nil)? If yes, we can remove this nil check. If no, we need to adjust API of this command or RouteOption to make route parameter optional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Yury-Fridlyand and @omangesg, I have to do opts.Route != nil to avoid error when doing the IsMultiNode() check.

func (route SimpleNodeRoute) IsMultiNode() bool {
return route != RandomRoute
}

@Yury-Fridlyand Yury-Fridlyand added the go golang wrapper label Feb 5, 2025
go/api/glide_cluster_client.go Outdated Show resolved Hide resolved
go/integTest/cluster_commands_test.go Outdated Show resolved Hide resolved
if err != nil {
return createEmptyClusterValue[int64](), err
}
if opts.Route != nil &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a user call ClientIdWithOptions(nil)? If yes, we can remove this nil check. If no, we need to adjust API of this command or RouteOption to make route parameter optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go golang wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants